/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  							 script_give_spell.h

	$Header: /heroes4/script_give_spell.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( SCRIPT_GIVE_SPELL_H_INCLUDED )
#define SCRIPT_GIVE_SPELL_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <iosfwd>

#include "script_hero_action.h"
#include "spell.h"

class t_hero;

// --------------------------------------------------------------------------
// t_script_give_spell class
// --------------------------------------------------------------------------

class t_script_give_spell
	:	public t_script_hero_action
{
public:
	// Constructor
	t_script_give_spell();

	// Member functions
	t_spell			get_spell() const;

	virtual bool	read( std::streambuf& stream, int version );
	virtual bool	read_from_map(
						std::streambuf &	stream,
						int					format_version );
	virtual bool	write( std::streambuf& stream ) const;

	virtual void	add_icons(t_basic_dialog* dialog) const;

private:
	// Data members
	t_spell		m_spell;

	void		do_action(t_hero* hero) const;
};

// --------------------------------------------------------------------------
// t_script_give_spell inline members
// --------------------------------------------------------------------------

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline t_script_give_spell::t_script_give_spell()
	:	m_spell( k_spell_bless )
{
}

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline t_spell t_script_give_spell::get_spell() const
{
	return m_spell;
}

SPECIALIZE_SCRIPT_ACTION( k_script_action_give_spell, t_script_give_spell );

#endif // !defined( SCRIPT_GIVE_SPELL_H_INCLUDED )
